Restore Button Module Properties

What is the command that is used in the Module Properties History Tab to restore the value of an attribute with everything, including pictures and OLEs?
SystemAdmin - Wed Apr 25 15:25:11 EDT 2012

Re: Restore Button Module Properties
SystemAdmin - Mon Jul 16 17:19:49 EDT 2012

Any clues?

Re: Restore Button Module Properties
Peter_Albert - Tue Jul 17 04:08:52 EDT 2012

SystemAdmin - Mon Jul 16 17:19:49 EDT 2012
Any clues?

There is not a single command to do this. You have to loop through history entries, then use hr.oldValue to obtain the rich text of the attribute value before the change, then assign this value to the attribute. Look at the "History" chapter of the DXL help, as you need other history properties like hr.type, hr.attrName, etc. to find the correct history record.

Cheers,

Peter

Re: Restore Button Module Properties
Peter_Albert - Tue Jul 17 04:10:59 EDT 2012

Peter_Albert - Tue Jul 17 04:08:52 EDT 2012
There is not a single command to do this. You have to loop through history entries, then use hr.oldValue to obtain the rich text of the attribute value before the change, then assign this value to the attribute. Look at the "History" chapter of the DXL help, as you need other history properties like hr.type, hr.attrName, etc. to find the correct history record.

Cheers,

Peter

OK, you asked for the command used in the Object properties dialogue box. This is likely

obj."Object Text" = richText hr.oldValue

but still you have to get the correct history record as written above.

Re: Restore Button Module Properties
Mathias Mamsch - Thu Aug 02 05:02:10 EDT 2012

Peter_Albert - Tue Jul 17 04:08:52 EDT 2012
There is not a single command to do this. You have to loop through history entries, then use hr.oldValue to obtain the rich text of the attribute value before the change, then assign this value to the attribute. Look at the "History" chapter of the DXL help, as you need other history properties like hr.type, hr.attrName, etc. to find the correct history record.

Cheers,

Peter

Well I wonder what the perm
 

bool undo (History h, Module m)

 


will do then. Did not try it but I thought it was to undo a history entry. Regards, Mathias

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

Re: Restore Button Module Properties
SystemAdmin - Thu Aug 02 10:25:10 EDT 2012

Peter_Albert - Tue Jul 17 04:10:59 EDT 2012

OK, you asked for the command used in the Object properties dialogue box. This is likely

obj."Object Text" = richText hr.oldValue

but still you have to get the correct history record as written above.

Greetings,
I used this script to restore the data from the Object Text. Just for your reference.
This one worked for me, because there was only one change per session, so I was able to restore the data I wanted with no issues. If you need to be more specific you can add, date, time anything that might help you.

Thanks for the inputs, I really appreciated.

void restore_Object_History(Object o, int sessNum, string atName){
    History h
        for h in o do{
                if(h.sessionNo == sessNum && h.attrName == atName){
                        o.atName = richText h.oldValue
                }
        }
}
 
Object o = current
restore_Object_History(o,18660,"Object Text")

Re: Restore Button Module Properties
SystemAdmin - Thu Aug 02 10:34:03 EDT 2012

Mathias Mamsch - Thu Aug 02 05:02:10 EDT 2012

Well I wonder what the perm
 

bool undo (History h, Module m)

 


will do then. Did not try it but I thought it was to undo a history entry. Regards, Mathias

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

This one works too. Thanks!!!

void restore_Object_History(Module m, Object o, int sessNum, string atName){
    History h
        for h in o do{
                if(h.type != modifyObject)continue
                if(h.sessionNo == sessNum && h.attrName == atName){
                        //o.atName = richText h.oldValue
                        bool b = undo(h, m)
                        //print b
                }
        }
}
 
Module m = current
Object o = current
restore_Object_History(m,o,18660,"Proposed Object Text")

Re: Restore Button Module Properties
Peter_Albert - Wed Aug 15 07:10:58 EDT 2012

Mathias Mamsch - Thu Aug 02 05:02:10 EDT 2012

Well I wonder what the perm
 

bool undo (History h, Module m)

 


will do then. Did not try it but I thought it was to undo a history entry. Regards, Mathias

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

Nice! It's never too late to learn undocumented DXL perms :-)